<?php

/**
 * inicio actions.
 *
 * @package    
 * @subpackage inicio
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class inicioActions extends sfActions {

    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request) {
        
        $this->proyectos = Doctrine_Core::getTable('proyecto')
                ->createQuery('a')
                ->execute();
        $this->fondos = Doctrine_Core::getTable('fondo')
                ->createQuery('a')
                ->execute();
        
        
        $this->usuario = Doctrine_Core::getTable('sfguarduser')
                ->createQuery('a')
                ->execute();
    }

    public function executePrueba(sfWebRequest $request) {
        $mysql_hostname = "localhost";
        $mysql_user = "root";
        $mysql_password = "";
        $mysql_database = "SistemaWebUnlSenescyt";
       $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) 
       or die("Opps some thing went wrong");
       mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
     
       $id=null;
       $firstname=null;
       try{
          if (isset ($_POST['id'])&& isset ($_POST['firstname'])) {
       
            $id = mysql_escape_String($_POST['id']);
            $firstname = mysql_escape_String($_POST['firstname']);
            $sql = "update valor set val='$firstname' where id_va='$id'";
            
            mysql_query($sql);
           }
       }catch(Exception $e){
           
           
       }  
        
    }

}
